package com.expressage.service.impl;

import com.expressage.dao.StreetAddressDao;
import com.expressage.service.StreetAddressService;
import com.expressage.vo.StreetAddressVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 街道地址业务逻辑实现类
 */

@Service
public class StreetAddressServiceImpl implements StreetAddressService {

    @Autowired
    StreetAddressDao streetAddressDao;

    @Override
    public List<StreetAddressVO> findAll() {
        return streetAddressDao.findAll();
    }

    @Override
    public StreetAddressVO findByStreetid(int streetid) {
        return streetAddressDao.findByStreetid(streetid);
    }

    @Override
    public List<StreetAddressVO> findByAreaid(int areaid) {
        return streetAddressDao.findByAreaid(areaid);
    }

    @Override
    public StreetAddressVO findByStreetName(String streetname) {
        return streetAddressDao.findByStreetName(streetname);
    }


    @Override
    public boolean insert(StreetAddressVO streetAddress) {
        return streetAddressDao.insert(streetAddress)>0?true:false;
    }

    @Override
    public boolean delete(int[] streetid) {
        return streetAddressDao.delete(streetid)>0?true:false;
    }

    @Override
    public boolean update(StreetAddressVO streetAddress) {
        return streetAddressDao.update(streetAddress)>0?true:false;
    }
}
